const express = require('express')
const { createProxyMiddleware } = require('http-proxy-middleware')
//跨域代理
let proxy = createProxyMiddleware({
  target: 'http://localhost:8848',
  changeOrigin: true,
})
const app = express()
app.listen(8888)

//静态资源托管
app.use(express.static('publi'))

app.use((req, res) => {
  proxy(req, res)
})